package com.example.helloworld;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.Html;
import android.widget.TextView;

public class TextViewActivity extends AppCompatActivity {
    private TextView Tv1;
    private TextView Tv2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text_view);
        Tv1 = findViewById(R.id.tv_1);
        Tv2 = findViewById(R.id.tv_2);

        Tv1.setText(Html.fromHtml("<u>文本</u>"));
//        Tv1.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
        Tv2.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
        Tv2.getPaint().setAntiAlias(true);

    }
}